﻿using MyDAL.helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class formStat : System.Web.UI.Page
    {
        private int tr;
        private int tc;
        protected void Page_Load(object sender, EventArgs e)
        {
            string[] rc = Request.QueryString["CommandArgument"].Split(',');
            tr = Convert.ToInt32(rc[0]);//获得传递的参数
            tc = Convert.ToInt32(rc[1]);
            if (DataHelper.GetInstance().JobList[tr].JobLYCPH)
            {
                Label1.Visible = true;
                Label1.Text = DataHelper.GetInstance().JobStrConfig.Lycph;
            }
            else
            {
                Label1.Visible = false;
            }
            if (DataHelper.GetInstance().JobList[tr].JobJCWTD.Count() > 0)
            {
                Label2.Visible = true;
                Label2.Text = DataHelper.GetInstance().JobStrConfig.Jcwtd;
            }
            else
            {
                Label2.Visible = false;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            DataHelper.GetInstance().JobList[tr].JobTotalTime = int.Parse(DropDownList1.Text);
            DataHelper.GetInstance().JobList[tr].JobStatTime = int.Parse(DropDownList2.Text) * 60 + int.Parse(DropDownList3.Text);
            DataHelper.GetInstance().refrashJobList();
            Response.Write("<script>alert('开始成功')</script>");
            Response.Write("<script>window.opener=null;window.close(); </script>");
        }
    }
}